package com.gm.corejava;

import java.io.File;
import java.io.IOException;

/**
 * Created by Administrator on 13-12-24.
 */
public class FindDir {
    public static void main(String[] args) {
        if (args.length == 0)
            args = new String[]{".."};

        try {
            File file = new File(args[0]);
            String[] fileNames = file.list();

            for (String fileName : fileNames) {
                File f = new File(file.getPath(), fileName);
                if (f.isDirectory()) {
                    System.out.println(f.getCanonicalPath());
                    main(new String[]{f.getPath()});
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
